network object
This method will return an array containing the unique ID's of all connected peers.
uint[] get_peer_list()
Parameters:
None.
Return value:
An array containing the unique ID's of all connected peers on success, or an array with 0 elements on error.
Remarks:
This method is useful for sending messages to all connected peers, as the returned array can easily be used in a loop to send the same message to everyone. Please note that the same functionality can be achieved by passing 0 as the peer ID to either the send_unreliable or send_reliable methods.
This function is also useful when you wish to disconnect all peers gracefully before destroying the host.
Example:
See the main network chapter.